// Copyright 2022 jeff.li. and/or its affiliates.

#pragma once

#include <tuple>

#include <tbir/runtime/object.h>

namespace tbir::runtime::details {


    struct iterator_npos {
    };

    template<size_t>
    struct iterator_int {
    };  // compile-time counter

/* Get the "minimum" of all iterators :
   - only random => random
   - at least one forward => forward
   */
    template<typename... Iters>
    struct iterator_min;

    template<typename T>
    struct iterator_min<T> {
        using type = typename std::iterator_traits<T>::iterator_category;
    };

    template<typename T, typename... Iters>
    struct iterator_min<T, Iters...> {
        using type =
        typename std::conditional<std::is_same<typename std::iterator_traits<T>::iterator_category,
                std::forward_iterator_tag>::value,
                std::forward_iterator_tag,
                typename iterator_min<Iters...>::type>::type;
    };

}  // namespace tbir::runtime::details
